Optimal. Leaf size=42 \[ -\frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\tanh ^{-1}(\cos (x))}{a+b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3269, 400, 212,
211} \begin {gather*} -\frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\tanh ^{-1}(\cos (x))}{a+b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 212
Rule 400
Rule 3269
Rubi steps
\begin {align*} \int \frac {\csc (x)}{a+b \cos ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {1}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\cos (x)\right )\\ &=-\frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (x)\right )}{a+b}-\frac {b \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\cos (x)\right )}{a+b}\\ &=-\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\tanh ^{-1}(\cos (x))}{a+b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 50, normalized size = 1.19 \begin {gather*} \frac {-\frac {2 \sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a}}+\log (1-\cos (x))-\log (1+\cos (x))}{2 (a+b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 56, normalized size = 1.33
method | result | size |
default | \(-\frac {\ln \left (\cos \left (x \right )+1\right )}{2 a +2 b}+\frac {\ln \left (-1+\cos \left (x \right )\right )}{2 a +2 b}-\frac {b \arctan \left (\frac {b \cos \left (x \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}\) | \(56\) |
risch | \(-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{a +b}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{a +b}+\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {a b}\, {\mathrm e}^{i x}}{b}+1\right )}{2 a \left (a +b \right )}-\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {a b}\, {\mathrm e}^{i x}}{b}+1\right )}{2 a \left (a +b \right )}\) | \(111\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 48, normalized size = 1.14 \begin {gather*} -\frac {b \arctan \left (\frac {b \cos \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\cos \left (x\right ) + 1\right )}{2 \, {\left (a + b\right )}} + \frac {\log \left (\cos \left (x\right ) - 1\right )}{2 \, {\left (a + b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.45, size = 113, normalized size = 2.69 \begin {gather*} \left [\frac {\sqrt {-\frac {b}{a}} \log \left (\frac {b \cos \left (x\right )^{2} - 2 \, a \sqrt {-\frac {b}{a}} \cos \left (x\right ) - a}{b \cos \left (x\right )^{2} + a}\right ) - \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )}}, -\frac {2 \, \sqrt {\frac {b}{a}} \arctan \left (\sqrt {\frac {b}{a}} \cos \left (x\right )\right ) + \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc {\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 50, normalized size = 1.19 \begin {gather*} -\frac {b \arctan \left (\frac {b \cos \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\cos \left (x\right ) + 1\right )}{2 \, {\left (a + b\right )}} + \frac {\log \left (-\cos \left (x\right ) + 1\right )}{2 \, {\left (a + b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.67, size = 853, normalized size = 20.31 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\frac {\left (\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2-\frac {\cos \left (x\right )\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}+4\,b^3\,\cos \left (x\right )\right )\,1{}\mathrm {i}}{2\,\left (a+b\right )}-\frac {\left (\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2+\frac {\cos \left (x\right )\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}-4\,b^3\,\cos \left (x\right )\right )\,1{}\mathrm {i}}{2\,\left (a+b\right )}}{\frac {\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2-\frac {\cos \left (x\right )\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}+4\,b^3\,\cos \left (x\right )}{2\,\left (a+b\right )}+\frac {\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2+\frac {\cos \left (x\right )\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}-4\,b^3\,\cos \left (x\right )}{2\,\left (a+b\right )}}\right )\,1{}\mathrm {i}}{a+b}+\frac {\mathrm {atan}\left (\frac {\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \left (x\right )+\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2-\frac {\cos \left (x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )\,1{}\mathrm {i}}{a^2+b\,a}+\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \left (x\right )-\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2+\frac {\cos \left (x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )\,1{}\mathrm {i}}{a^2+b\,a}}{\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \left (x\right )+\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2-\frac {\cos \left (x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )}{a^2+b\,a}-\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \left (x\right )-\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2+\frac {\cos \left (x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )}{a^2+b\,a}}\right )\,\sqrt {-a\,b}\,1{}\mathrm {i}}{a\,\left (a+b\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________